package com.kc.gb.device.service.impl;

import com.kc.gb.device.common.dto.CameraConfig;
import com.kc.gb.device.plugins.camera.service.CameraHardwareService;
import com.kc.gb.device.service.CameraAdminService;
import com.kc.gb.device.service.support.dto.CameraMockDto;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.atomic.AtomicBoolean;

@Service
public class CameraAdminServiceImpl implements CameraAdminService {

    @Resource
    CameraHardwareService cameraHardwareService;

    AtomicBoolean DEBUG_MODE = new AtomicBoolean(false);

    @Override
    public void report(CameraMockDto mockDto) {
        CameraConfig config = new CameraConfig();
        BeanUtils.copyProperties(mockDto, config);
        String message = mockDto.getMessage();
        cameraHardwareService.report(config,message);
    }
}
